home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
util
/
wb
/
mrjQuote.lha
/
mrjQuote2.30
/
ARexx
/
IndentAddSig.ged
< prev
next >
Wrap
Text File
|
1996-09-27
|
5KB
|
101 lines
/* GoldEd / mrjQuote email/news indenter and signature appender
©1996 Mark Rigby-Jones for mrjsw
mark.rigby-jones@keble.oxford.ac.uk <*> http://users.ox.ac.uk/~kebl0206/
$VER: IndentAddSig.ged 1.4 (27.09.96)
This script is intende for use when editing emails/news articles with
GoldEd. It will add an indent ("> " by default) to every non-empty line
from the cursor position downward. It will then use mrjQuote to generate
a random signature and append this to the buffer, together with the dashes
"-- " and a little extra space.
Configuration:
Set QuotePort to the name of mrjQuote's ARexx port, and FileName and
SigName to the correct paths. Change DoSig from "load" to "yes" if you do
not want mrjQuote to be loaded if it isn't already (a new signature will
not be created in this case)
Usage:
Put this script in GOLDED:ARexx/ and create a button, menu or whatever in
GoldEd with type arexx and one of the following commands:
"GOLDED:ARexx/IndentAddSig" - indent text and add signature
"GOLDED:ARexx/IndentAddSig NOINDENT" - add signature only
"GOLDED:ARexx/IndentAddSig NOSIG" - indent text only */
QuotePort = "QUOTE" /* Change this if neccessary */
FileName = "mrjsw:Quote" /* Full path to mrjQuote */
SigName = "Home:.signature" /* Full path to signature */
Indent = "> " /* What to use as an indent */
DoSig = "load" /* Default signature mode */
Arg Opt . /* Parse any argument */
If Opt = "NOINDENT" Then /* Indenting disabled */
Indent=""
If Opt = "NOSIG" Then /* Signature disabled */
DoSig="no"
Options Results /* Enable return codes */
If (Left(Address(),6) ~= "GOLDED") Then
Address "GOLDED.1"
GoldEdPort = Address() /* Get GoldEd's port name */
'LOCK CURRENT RELEASE=4' /* Lock GUI, gain access */
If (RC ~= 0) Then
Exit
Options FailAt 6 /* Ignore warnings */
Signal On Syntax /* Ensure clean exit */
'QUERY LINES VAR LINES' /* Get number of lines */
'QUERY LINE VAR LINE' /* Get current line */
FIRST /* Move to start of line */
Do i = LINE To LINES /* Until end of file */
'QUERY LEN VAR LEN' /* get info about line */
If LEN>1 /* if line is non-blank */
Then 'TEXT T "'Indent'" STAY' /* add Indent to start */
DOWN
End /* move to next line */
If DoSig = "no" Then Do /* If not to do signature */
GOTO EOL
TEXT CR /* add an extra blank line */
UNLOCK /* unlock GoldEd */
Exit /* and exit the script */
End
If (~Show(P,QuotePort) & DoSig="load") Then Do /* If mrjQuote isn't loaded */
Address "COMMAND"
'Run >NIL: "'FileName'" CDITY AREXX QUIET' /* then run it */
WaitForPort QuotePort /* and wait for it to load */
End
If Show(P,QuotePort) Then Do /* If mrjQuote is running */
Address Value QuotePort
Sig /* create a random sig */
Address Value GoldEdPort
End
'OPEN NAME "'SigName'" APPEND' /* append signature file */
DOWN
TEXT CR /* insert blank line */
If LINE > 1 Then /* " if file non-empty */
TEXT CR
If LEN > 1 Then /* " if line non-empty */
TEXT CR
TEXT T "-- " CR /* insert sig-break */
UP
UP /* move cursor back up */
UP
UNLOCK /* Unlock GoldEd */
Exit
Syntax: /* If there's an error */
Say "Error, line "SIGL" : "ErrorText(RC) /* display details */
Address Value GoldEdPort
UNLOCK /* and unlock GoldEd */
Exit